﻿@{
    ViewBag.Title = "SGTD Hidrandina | Consultar Tramites";
    ViewBag.MenuConsulta = "current_page_item";
    Layout = "~/Views/Shared/_Maestro.cshtml";
}  

@model  SGTD.Models.Captcha
    
   
    <link href="@Url.Content("~/Content/css/frank.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Scripts/jquery-ui-1.8.14.custom.css")" rel="stylesheet" type="text/css" />     
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.13.custom.min.js")" type="text/javascript"></script> 
  
    
    @*-----------captcha----------*@
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Scripts/modernizr.custom.29473.js")" type="text/javascript"></script>


      <script type="text/javascript">

          $.ajaxSetup({ cache: false });

          $(document).ready(function () {
              $(".openDialog").live("click", function (e) {
                  e.preventDefault();

                  $("<div></div>")
                    .addClass("dialog")
                    .dialog({
                        title: $(this).attr("data-dialog-title"),
                        close: function () { $(this).remove(); },
                        modal: true,
                        height: 350,
                        width: 750,
                        left: 0

                    })
                    .load(this.href);
              });

              $(".close").live("click", function (e) {
                  e.preventDefault();
                  $(this).closest(".dialog").dialog("close");
              });
          });
    </script>


<h2>ConsultarTramites</h2>
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
 <table class="style1">
        <tr>
            <td class="style4" colspan="4">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6" rowspan="5">
                <img alt="" src="../../Content/images/peru1.jpg" style="height: 300px; width: 250px" /></td>


            <td class="style7">
                <div class="editor-label">
                    DNI:
                </div>
            </td>
            <td class="style5">
                
               @Html.Partial("_dni", new SGTD.Models.fichatramite())
              
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                Codigo Validacion:</td>
            <td class="style5">
                @Html.Partial("_Captcha", new SGTD.Models.Captcha())
                @Html.Partial("_InvisibleCaptcha", new SGTD.Models.InvisibleCaptcha())    
            </td>
            <td>

            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style5">
                <p>
                    <input type="submit" value="Consultar" id="btnConsultar" class="button-style"  />
                    <input id="btnLimpiar" type="button" value="Limpiar" class="button-style"  /></p>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2" colspan="2">
                <section class="ac-container">
                 <div>
                    @if (ViewData["listafichas"] != null)
                    {
                        var dniconsulta = ViewData["dnibusqueda"];
                        var list = (List<SGTD.Entidades.clsFichaTramiteDocumento>)ViewData["listafichas"];

                        int idFicha = 0;
                        foreach (SGTD.Entidades.clsFichaTramiteDocumento item in list)
                            {
                                if (idFicha == @item.FichaTramite.IdFichaTramite)
                                { 
                                  <article class="ac-small"> 
                                  <ul>
                                        <li class="inline">@item.Documento.IdDocumento</li>

                                        <li class="inline">@item.Asunto</li>

                                        <li class="last">@Html.ActionLink("Detalle", "DetalleConsulta", "FichaTramiteDocumento", new {dni=dniconsulta, idFicha = @item.FichaTramite.IdFichaTramite, iddoc = @item.Documento.IdDocumento }, new { @class = "openDialog", data_dialog_title = "Detalle de Documento" })
                                        </li>
                                   </ul> 

                                 </article>                               
                                }
                                else
                                {
                                    idFicha = @item.FichaTramite.IdFichaTramite;
                                    <input id='@item.FichaTramite.IdFichaTramite' name="accordion-1" type="radio" checked />     
                                    <label for='@item.FichaTramite.IdFichaTramite' >Ficha de Tramite: @item.FichaTramite.IdFichaTramite</label> 
                                    <article class="ac-small">
                                        <br />
                                        
                                        <ul style="background-color:GrayText">
                                            <li class="inline" >Codigo Documento</li>

                                            <li class="inline">Asunto</li>

                                            <li class="last"></li>
                                        </ul>
                                        <ul>
                                            <li class="inline">@item.Documento.IdDocumento</li>

                                            <li class="inline">@item.Asunto</li>

                                            <li class="last">@Html.ActionLink("Detalle", "DetalleConsulta", "FichaTramiteDocumento", new {dni= dniconsulta, idFicha = @item.FichaTramite.IdFichaTramite, iddoc = @item.Documento.IdDocumento }, new { @class = "openDialog", data_dialog_title = "Detalle de Documento" })
                                            </li>
                                        </ul> 
					               </article>
                                }
                            }
                            
                            
                    }

                </div>
              </section>
            </td>
            <td>&nbsp;</td>
        </tr>
    </table>
    <div class="bloque-test">
    </div>
    
   
}
